/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

package com.huawei.api.bean;

import lombok.Data;
import org.apache.commons.exec.CommandLine;

/**
 * 命令信息
 *
 * @since 2023/10/28
 */
@Data
public class CommandInfo {
    /**
     * 可执行命令行字符串
     */
    private CommandLine commandLine;

    /**
     * 生成的报告路径
     */
    private String reportFilePath;

    /**
     * 运行项目的根目录
     */
    private String runDir;

    /**
     * 命令期望返回值
     */
    private int expectCode;

    public CommandInfo(CommandLine commandLine, String reportFilePath) {
        this.commandLine = commandLine;
        this.reportFilePath = reportFilePath;
        // 没主动设置expectCode时，默认设置为0
        this.expectCode = 0;
    }

    public CommandInfo(CommandLine commandLine, String reportFilePath, int expectCode) {
        this.commandLine = commandLine;
        this.reportFilePath = reportFilePath;
        this.expectCode = expectCode;
    }
}
